﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CoreLib;
namespace CoreLib.Components
{
   public class SpriteComponent:CBaseComponent
    {
        Rectangle spriteRectangle;

        public Rectangle SpriteRectangle
        {
            get { return spriteRectangle; }
            set { spriteRectangle = value; }
        }
        Texture2D texture;

        public Texture2D Texture
        {
            get { return texture; }
            set { texture = value; }
        }
        string assetName;

        public string AssetName
        {
            get { return assetName; }
            set { assetName = value; }
        }
      
        public SpriteComponent(Game game)
            : base(game)
        {
            Enabled = true;
        }
        protected override void LoadContent()
        {
            Texture = Engine.game.Content.Load<Texture2D>(AssetName);
            SpriteRectangle = new Rectangle(0,0,Texture.Width,Texture.Height);
            Engine.SpriteList.Add(this);
            base.LoadContent();
        }
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }

     
    }
}
